﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Urgencias.Controlador;

namespace Urgencias.Vista
{
    public partial class IngresarInsumosUC : UserControl
    {
        public IngresarInsumosUC()
        {
            InitializeComponent();
        }

        private void InsumoTB_TextChanged(object sender, EventArgs e)
        {

        }

        private void AceptarBTM_Click(object sender, EventArgs e)
        {
            decimal precio = precioInsumoUD.Value;
            int codigoInsumo;
            if (InsumoControlador.Instance.ingresarInsumo(nombreInsumoTB.Text, precio,out codigoInsumo))
            {
                MessageBox.Show(Properties.Resources.InsumoIngreso+ " "+codigoInsumo);
            }
            else
            {
                MessageBox.Show(Properties.Resources.ErrorIngresoInsumo);
            }
        }
    }
}
